package org.dtrd.modules.doctor.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.doctor.entity.bean.DoctorStatisticInfoDetail;

import java.util.Date;


/**
 * <p>
 * 医生相关的统计数据
 * </p>
 *
 * @author QR
 * @since 2022-04-14
 */
@Getter
@Setter
@TableName("dtrd_ent_rd_doctor_statistic_info")
public class DtrdEntRdDoctorStatisticInfo {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    /**
     * 医生id
     */
    @TableField("doctor_id")
    private Integer doctorId;

    @TableField("org_code")
    private String orgCode;

    @TableField("team_id")
    private Integer teamId;

    /**
     * 患者总数
     */
    @TableField("patient_count")
    private Integer patientCount;

    /**
     * 糖尿病前期
     */
    @TableField("patient_prediabetes")
    private Integer patientPrediabetes;

    /**
     * 患者测量血糖总数
     */
    @TableField("patient_sugar_count")
    private Integer patientSugarCount;

    /**
     * 男性患者数
     */
    @TableField("patient_sex_male")
    private Integer patientSexMale;

    /**
     * 女性患者数
     */
    @TableField("patient_sex_female")
    private Integer patientSexFemale;

    /**
     * 1型糖尿病患者数
     */
    @TableField("patient_diabetes_type1")
    private Integer patientDiabetesType1;

    /**
     * 2型糖尿病患者数
     */
    @TableField("patient_diabetes_type2")
    private Integer patientDiabetesType2;

    /**
     * 妊娠糖尿病患者数
     */
    @TableField("patient_diabetes_type_gestation")
    private Integer patientDiabetesTypeGestation;

    /**
     * 其他类型糖尿病患者数
     */
    @TableField("patient_diabetes_type_other")
    private Integer patientDiabetesTypeOther;

    /**
     * 0-10岁
     */
    @TableField("patient_age_1")
    private Integer patientAge1;

    /**
     * 11-20岁
     */
    @TableField("patient_age_2")
    private Integer patientAge2;

    /**
     * 20-40岁
     */
    @TableField("patient_age_3")
    private Integer patientAge3;

    /**
     * 40-60岁
     */
    @TableField("patient_age_4")
    private Integer patientAge4;

    /**
     * 60岁以上
     */
    @TableField("patient_age_5")
    private Integer patientAge5;

    /**
     * 1年以下
     */
    @TableField("patient_sugar_age_1")
    private Integer patientSugarAge1;

    /**
     * 1年到5年
     */
    @TableField("patient_sugar_age_2")
    private Integer patientSugarAge2;

    /**
     * 5年到10年
     */
    @TableField("patient_sugar_age_3")
    private Integer patientSugarAge3;

    /**
     * 10年以上
     */
    @TableField("patient_sugar_age_4")
    private Integer patientSugarAge4;

    /**
     * 未用药
     */
    @TableField("patient_drug_type1")
    private Integer patientDrugType1;

    /**
     * 口服药
     */
    @TableField("patient_drug_type2")
    private Integer patientDrugType2;

    /**
     * 胰岛素
     */
    @TableField("patient_drug_type3")
    private Integer patientDrugType3;

    /**
     * 血糖打卡情况
     */
    @TableField("patient_signin_sugar")
    private String patientSigninSugar;

    /**
     * 饮食打卡情况
     */
    @TableField("patient_signin_diet")
    private String patientSigninDiet;

    /**
     * 运动打卡情况
     */
    @TableField("patient_signin_sport")
    private String patientSigninSport;

    /**
     * 用药打卡情况
     */
    @TableField("patient_signin_medical")
    private String patientSigninMedical;

    /**
     * 胰岛素打卡情况
     */
    @TableField("patient_signin_insulin")
    private String patientSigninInsulin;

    /**
     * 血压打卡情况
     */
    @TableField("patient_signin_pressure")
    private String patientSigninPressure;

    /**
     * 尿酮打卡情况
     */
    @TableField("patient_signin_ketone")
    private String patientSigninKetone;

    /**
     * 腰围打卡情况
     */
    @TableField("patient_signin_waist")
    private String patientSigninWaist;

    /**
     * 体重打卡情况
     */
    @TableField("patient_signin_weight")
    private String patientSigninWeight;

    /**
     * 睡眠打卡情况
     */
    @TableField("patient_signin_sleep")
    private String patientSigninSleep;

    /**
     * 营养素打卡情况
     */
    @TableField("patient_signin_nutrient")
    private String patientSigninNutrient;

    @TableField("patient_signin_bar_chart")
    private String patientSigninBarChart;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    @TableField("create_time")
    private Date createTime;

    public DtrdEntRdDoctorStatisticInfo init() {
        isDel = 0;
        createTime = new Date();
        return this;
    }

    public DtrdEntRdDoctorStatisticInfo parseFromDTO(DoctorStatisticInfoDetail dto) {
        dataId = dto.getDataId();
        doctorId = dto.getDoctorId();
        patientCount = dto.getPatientCount();
        patientPrediabetes = dto.getPatientPrediabetes();
        patientSugarCount = dto.getPatientSugarCount();
        patientSexMale = dto.getPatientSexMale();
        patientSexFemale = dto.getPatientSexFemale();
        patientDiabetesType1 = dto.getPatientDiabetesType1();
        patientDiabetesType2 = dto.getPatientDiabetesType2();
        patientDiabetesTypeGestation = dto.getPatientDiabetesTypeGestation();
        patientDiabetesTypeOther = dto.getPatientDiabetesTypeOther();
        patientAge1 = dto.getPatientAge1();
        patientAge2 = dto.getPatientAge2();
        patientAge3 = dto.getPatientAge3();
        patientAge4 = dto.getPatientAge4();
        patientAge5 = dto.getPatientAge5();
        patientSugarAge1 = dto.getPatientSugarAge1();
        patientSugarAge2 = dto.getPatientSugarAge2();
        patientSugarAge3 = dto.getPatientSugarAge3();
        patientSugarAge4 = dto.getPatientSugarAge4();
        patientSigninSugar = dto.getPatientSigninSugar();
        patientSigninDiet = dto.getPatientSigninDiet();
        patientSigninSport = dto.getPatientSigninSport();
        patientSigninMedical = dto.getPatientSigninMedical();
        patientSigninInsulin = dto.getPatientSigninInsulin();
        patientSigninPressure = dto.getPatientSigninPressure();
        patientSigninKetone = dto.getPatientSigninKetone();
        patientSigninWaist = dto.getPatientSigninWaist();
        patientSigninWeight = dto.getPatientSigninWeight();
        patientSigninSleep = dto.getPatientSigninSleep();
        patientSigninNutrient = dto.getPatientSigninNutrient();
        return this;
    }

}
